Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent poisonous foods from softlocking the game #3183

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

chaosvolt
Copy link
Member

Summary

SUMMARY: Bugfixes "Add UNSAFE_CONSUME to several foods that triggered query on eat, to prevent them from softlocking when placed in an auto-eat zone"

Purpose of change

Viss pointed out to me that if an item in an auto-eat zone has a poison use action or other thing that prompts you about if you want to eat them, but lacks the UNSAFE_CONSUME flag, you'll be trapped in an infinite loop should it decide to eat that item, where your only options are to either succumb to peer pressure and eat eat morel mushrooms, or to force-quit the game.

I figured fix all potential cases of this in the JSON for a quick fix to potential softlocks now, and look at the code to make it stop doing that in a separate PR.

Describe the solution

  1. Added UNSAFE_CONSUME flag to morel mushrooms.
  2. Set it so cooked morel mushrooms remove the flag. Fried already does so innately due to overriding the flags.
  3. Added UNSAFE_CONSUME to the seed abstract, so that all seeds inheriting from it will be skipped over too. This is because the prompt for comestibles with seed_data triggers this same issue.
  4. Added the flag to garlic cloves, which don't inherit from seeds. It seems to work fine in testing but better safe than sorry, plus plantable seeds in general probably should be skipped over.
  5. Added the flag to cannabis seeds, which inherit from the seed abstract but override the flags.
  6. Added the flag to marloss seeds, since they don't inherit from seeds. Also they're fungal stuff so.
  7. Added the flag to Kentucky coffee pods, as they're poisonous.
  8. Added the flag to dogbane, as it has the BLECH use action.
  9. Added the flag to tainted meat, as it has the POISON use action. Testing confirmed these should be skipped over due to not bein fun to eat, but better safe than sorry due to the softlock potential. Plus, dehydrated tainted meat DOES trigger the softlock due to being above -5 fun, and it inherits from this so.
  10. Did the same for tainted bones, tainted fat, and tainted tallow, as above.
  11. Also added to raw hide just in case, which in turn covers tainted hides.
  12. Added to leech flowers, as it gives a fairly potent drug effect while being fun enough it might be eaten anyway.
  13. Also added to blob globs, tainted bone meal, and embalmed human brains to continue to be certain.
  14. Set alien fungus chunks to extend the flag onto its flag list, since it inherits from plant marrow. Confirmed by testing that it can trigger the softlock without this.
  15. Added the flag to commercial fertilizer, one of the only chemical items not in the comestible folder that didn't already have this flag.

Describe alternatives you've considered

Focusing on hunting down all the obscure code interactions behind the root problem and fixing them first but weh.

Testing

Checked affected files for syntax and lint errors.

I also tested a few of the odd cases as mentioned above, in particular garlic cloves are technically safe for reasons I'm not sure of without source-diving to find exactly why the seed prompt triggers. Better off doing so since plantable seeds are generally better off saved anyway, and cloves still count as seeds.

Additional context

So I was gonna test if this was still a problem in DDA but on the build I tried (2023-08-10-1558) auto-eat zones just don't even work at all, I tested waiting around with some jerky in it too and the character wouldn't eat that either, even after confirming that they weren't freezing.

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Sep 19, 2023
Copy link
Contributor

@Lamandus Lamandus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@Lamandus Lamandus merged commit da723f2 into cataclysmbnteam:upload Sep 19, 2023
14 checks passed
@chaosvolt chaosvolt deleted the mycus-must-let-me-go branch September 19, 2023 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants